package AggregationMethod;

import java.util.ArrayList;

import Definitions.NodeClass;
import Sampling.SamplingAbstractClass;

/*****************************************************************
* Name : BinaryExistanceMethod
* Aim : This class aims to keep the methods for the BinaryExistanceMethod Neighborhood 
* Calculation Function type and inherited from the NeighbourhoodFunction *
* * Algorithm : 1 2 3 0 5 -> 1 1 1 0 1
*****************************************************************/
public class BinaryExistanceMethodClass extends NeighbourhoodFunctionAbstractClass 
{
	public BinaryExistanceMethodClass(SamplingAbstractClass currentSampling){
		super(currentSampling);
		// TODO Auto-generated constructor stub
		name ="BinaryExistanceMethod";
	}
	
	/*****************************************************************
	* Function Name: 	binaryExistanceOfEdge
	* Aim: 				perform the BinaryExistanceMethod
	* Inputs: 			ArrayList<Node> node : The neighbors that will be used for the method
	* 					int usePredictOrActual : Predicted Classes or actual classes will be used 
	* 											when choosing neighbors
	* Outputs: 			countOfEdges
	* Data Structures:  ---
	* Algorithms: 		---
	*****************************************************************/
	public ArrayList<Double> getAggregatedNeighbourVector(ArrayList<NodeClass> nodeList)
	{
		ArrayList<Double> countOfEdges=new ArrayList<Double>();
		countOfEdges= this.countEdge(nodeList);
		for(int i = 0; i<countOfEdges.size(); i++)
		{
			if(countOfEdges.get(i) > 0)
			{
				countOfEdges.set(i, (double)1);		
			}
		}

		return countOfEdges;
	}
	
}
